﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="EditarPedido.aspx.cs" Inherits="Intelsi.WB.EditarPedido" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

 <script type="text/javascript">
     $(function () {
         $("#<%= TxtDesPro.ClientID %>").autocomplete({
             source: "/Service/ProyectoService.asmx/GetFromProyectoBYCriterio",
             minLength: 2,
             focus: function (event, ui) {
                 var select = ui.item;
                 $(this).val(select.label);



                 return false;
             },

             select: function (event, ui) {
                 var select = ui.item;
                 $(this).val(select.label);

                 $('#<%= TxtOrdeser.ClientID %>').val(select.proyecto.ordenServicio);
                 $('#<%= TxtEmpresa.ClientID %>').val(select.proyecto.empresa);

                 return false;
             }

         }
          );

         $("#<%= TxtDescProdu.ClientID %>").autocomplete({
             source: "/Service/ProductoService.asmx/GetGromProductoByDescripcion",
             minLength: 2,
             focus: function (event, ui) {
                 var select = ui.item;
                 $(this).val(select.label);

                 return false;
             },

             select: function (event, ui) {
                 var select = ui.item;
                 $(this).val(select.label);

                 $('#<%= TxtCodProd.ClientID %>').val(select.producto.codigo);
                 $('#<%= TxtMarca.ClientID %>').val(select.producto.marca);
                 $("#<%= TxtCantidad.ClientID %>").val("1");


                 return false;
             }

         }
          );

     });

           

    </script>



</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

        <fieldset>

            <fieldset id= "fspedido"
            <br />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                Numero Pedido:
                <asp:TextBox ID="TxtNumPedi" runat="server"></asp:TextBox>
            
            &nbsp;&nbsp; Fecha:
                <asp:TextBox ID="TxtFechaPedido" runat="server"></asp:TextBox>
            <br />
            </fieldset>

        <br />
       
            <fieldset id="fssupervisor">
                <legend> Datos Supervisor</legend>
                <asp:HiddenField ID="hfIdTrabajador" runat="server" />   
                Apellidos Y nombres:<asp:TextBox ID="TxtNombSup"
                    runat="server" Width="175px"></asp:TextBox>

            &nbsp;DNI:
                <asp:TextBox ID="TxtDniSup" runat="server"></asp:TextBox>

                <br />
                <br />
                Numero Fotochetk:&nbsp;
                <asp:TextBox ID="TxtNumeFotoEmpl" runat="server" Width="152px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Celular:<asp:TextBox ID="TxtCeluEmpre" runat="server" Width="137px"></asp:TextBox>
                <br />

            </fieldset>
        <br />
          <br />
      
            <fieldset id="fsproyecto">
                <legend>Datos Proyecto </legend>
                 <asp:HiddenField ID="hfIdProyecto" runat="server" />   
            &nbsp;Ingrese Descripcion Proyecto:
                <asp:TextBox ID="TxtDesPro" runat="server" Width="267px" Height="22px"></asp:TextBox>
                <br />
                <br />
&nbsp;Numero Orden Servicio:
                <asp:TextBox ID="TxtOrdeser" runat="server" Width="122px"></asp:TextBox>
                    
            &nbsp;&nbsp; Empresa:
                <asp:TextBox ID="TxtEmpresa" runat="server" Width="152px"></asp:TextBox>
                    
            </fieldset>
        <br />
          <br />

            <fieldset id="fsproducto">
                <legend> Productos </legend>
                 <asp:HiddenField ID="hfIdProducto" runat="server" />
            
            &nbsp;Descripcion:
                <asp:TextBox ID="TxtDescProdu" runat="server" Height="22px" Width="249px"></asp:TextBox>
&nbsp;Codigo:<asp:TextBox ID="TxtCodProd" runat="server" Width="103px"></asp:TextBox>
                <br />
                <br />
&nbsp;Marca:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:TextBox ID="TxtMarca" runat="server" Height="22px" Width="172px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cantidad:<asp:TextBox ID="TxtCantidad" runat="server" Width="112px"></asp:TextBox>

            
            </fieldset>  
            
         <br />

         </fieldset>
          <br />


            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="BtnAgregar" runat="server" Text="Agregar" 
                onclick="BtnAgregar_Click" />
&nbsp;<br />
            <br />

            <div>
               <asp:UpdatePanel ID="Panelproductos" runat="server">
                   <ContentTemplate>
                       <asp:GridView ID="GrillaPedido" runat="server" AutoGenerateColumns="False" 
                           Width="551px" CellPadding="4" ForeColor="#333333" GridLines="None">

                           <AlternatingRowStyle BackColor="White" ForeColor="#284775" />

                           <Columns>

                              
                               <asp:TemplateField HeaderText="Codigo">
                               <ItemTemplate>
                                <%#Eval("Codigo")%>
                               </ItemTemplate>

                               </asp:TemplateField>
                               <asp:TemplateField HeaderText="Descripcion">
                                    <ItemTemplate>
                                      <%#Eval("Descripcion")%>
                                    </ItemTemplate>
                               
                               </asp:TemplateField>
                               
                               
                               <asp:TemplateField HeaderText="Marca">
                                    <ItemTemplate>
                                        <%#Eval("NombreMarca")%>
                                    
                                    </ItemTemplate>
                               
                               </asp:TemplateField>
                               

                               <asp:TemplateField HeaderText="Cantidad">
                                    <ItemTemplate>
                                        
                                            
                                            <asp:TextBox ID="txtcantidad" runat="server" Height="20px" Width="43px" Text = '<%#Eval("Cantidad")%>' >
                                            
                                            </asp:TextBox>
                       
                                        
                                    </ItemTemplate>
                               </asp:TemplateField>

                               <asp:TemplateField HeaderText="Existencia">
                                    <ItemTemplate>
                                        <%#Eval("Existencia") %>
                                    </ItemTemplate>
                               </asp:TemplateField>

                               <asp:ButtonField ButtonType="Image" CommandName="Quitar" 
                       ImageUrl="~/Styles/images/delete.png" HeaderText="Eliminar" />

                           </Columns>

                           <EditRowStyle BackColor="#999999" />
                           <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                           <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                           <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                           <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                           <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                           <SortedAscendingCellStyle BackColor="#E9E7E2" />
                           <SortedAscendingHeaderStyle BackColor="#506C8C" />
                           <SortedDescendingCellStyle BackColor="#FFFDF8" />
                           <SortedDescendingHeaderStyle BackColor="#6F8DAE" />

                       </asp:GridView>
                   </ContentTemplate>

               </asp:UpdatePanel>
            </div>

        </fieldset>

    

</asp:Content>
